package com.eclipse.training.cheatsheets;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;

import com.eclipse.training.extensions.Activator;

public class ItemAttribute extends AbstractItemExtensionElement {

	@SuppressWarnings("unused")
	private String attributeValue;

	public ItemAttribute(String attributeName) {
		super(attributeName);
	}

	@Override
	public void handleAttribute(String attributeValue) {
		this.attributeValue = attributeValue;
	}

	@Override
	public void createControl(Composite composite) {
		// get the image from ImageRegistry
		Image image = Activator.getDefault().getImage(Activator.IMAGE_TRAINING);

		// add a label to composite
		Label label = new Label(composite, SWT.BORDER);
		// Use the label to display the image
		label.setImage(image);
	}

	@Override
	public void dispose() {

	}

}
